package com.lxlg.lxlg_order.app.controller;


import com.lxlg.core.utils.Result;
import com.lxlg.lxlg_order.client.MembershipLevelsClient;
import com.lxlg.lxlg_order.client.param.MemberShipLevelsForm;

import com.lxlg.lxlg_order.service.service.MembershipLevelsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kevin
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/infra/membership-levels")
@Api("会员等级接口")
public class MembershipLevelsController implements MembershipLevelsClient {
    @Autowired
    private MembershipLevelsService membershipLevelsService;


    @Override
    @PostMapping("creagteVipLevels")
    @ApiOperation("新增或修改等级接口 只有0，1，2")
    public Result<String> newMemberShipLevels(@Valid @RequestBody MemberShipLevelsForm vipLevelsForm) {
        membershipLevelsService.addMemberShipLevels(vipLevelsForm);

        return Result.getInstance(String.class).setData("添加成功");



    }
}

